package com.csdn.leon.base;

import com.csdn.leon.interf.DialogControl;
import com.csdn.leon.view.dialog.DialogHelper;
import com.csdn.leon.view.dialog.WaitDialog;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Window;

public class BaseActivity extends FragmentActivity implements DialogControl {
	  private WaitDialog waitDialog;
	@Override
	protected void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		AppManager.getInstance().addActivity(this);
	}

	@Override
	public void hideWaitDialog() {

		if(waitDialog != null){
			waitDialog.dismiss();
			waitDialog = null;
		}
	}

	@Override
	public WaitDialog showWaitDialog() {
		if(waitDialog == null){
			waitDialog = DialogHelper.getWaitDialog(this);
		}
		if(waitDialog != null){
			waitDialog.show();
		}
		
		return waitDialog;
	}

	@Override
	public WaitDialog showWaitDialog(int resid) {
		return null;
	}

	@Override
	public WaitDialog showWaitDialog(String text) {
		return null;
	}

}
